from django.db import models


# Create your models here.
class Product(models.Model):
    product_id = models.IntegerField(unique=True)
    product_name = models.CharField(max_length=20)
    product_type = models.IntegerField()
    product_description = models.CharField(max_length=255)
    product_img = models.CharField(max_length=255)
    product_price = models.DecimalField(max_digits=4, decimal_places=2)
    product_state = models.IntegerField()


class ProductType(models.Model):
    type_id = models.IntegerField(unique=True)
    type_name = models.CharField(max_length=20)


class Cart(models.Model):
    # cart_id = models.IntegerField(unique=True)
    user_id = models.IntegerField()
    product_id = models.IntegerField()
    product_discount = models.DecimalField(max_digits=4, null=True, decimal_places=2)


class Deal(models.Model):
    deal_id = models.IntegerField(unique=True)
    user_id = models.IntegerField()
    product_id = models.IntegerField()
    deal_timestamp = models.DateTimeField()
    product_discount = models.DecimalField(max_digits=4, null=True, decimal_places=2)


class Favorite(models.Model):
    # favorite_id = models.IntegerField(unique=True)
    user_id = models.IntegerField()
    product_id = models.IntegerField()
